//
//  YTDisNoticeCell.m
//  CllForIOS
//
//  Created by qiyun on 2018/3/31.
//  Copyright © 2018年 aRui. All rights reserved.
//

#import "YTDisNoticeCell.h"
@interface YTDisNoticeCell ()

@end
@implementation YTDisNoticeCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self makeUI];
    }
    return self;
}

- (void)makeUI{
    UILabel *hotlabel =[[UILabel alloc]init];
    hotlabel.textColor=[UIColor whiteColor];
    hotlabel.font=KFONT_medium(16);
    hotlabel.text=@"最热";
    hotlabel.textAlignment=NSTextAlignmentCenter;
    hotlabel.backgroundColor=RGBA(201, 23, 23);
    hotlabel.layer.cornerRadius=4;
    hotlabel.layer.masksToBounds = true;
    [self.contentView addSubview:hotlabel];
    self.hotlabel = hotlabel;
    self.hotlabel.hidden=YES;
    
    //
    UILabel *deslabel =[[UILabel alloc]init];
    deslabel.textColor=[UIColor blackColor];
    deslabel.font=KFONT(12);
    deslabel.text=@"此处不要超过12个字啦啦啦";
    deslabel.numberOfLines=1;
    [self.contentView addSubview:deslabel];
    self.deslabel = deslabel;
    
    UIImageView*circleimg=[[UIImageView alloc]init];
    circleimg.image=IMAGE(@"dis_cell_cy");
    [self.contentView addSubview:circleimg];
    self.circleimg=circleimg;
    
    UIImageView*rightimg=[[UIImageView alloc]init];
    rightimg.image=IMAGE(@"dis_cell_r");
    [self.contentView addSubview:rightimg];
    self.rightimg=rightimg;
    
    
}
-(void)layoutSubviews{
    [super layoutSubviews];
    
    
    self.deslabel.frame=CGRectMake(AfW(92), AfW(21), AfW(206), AfW(15));
    CGPoint iconcenter= self.deslabel.center;
    iconcenter.y=self.contentView.frame.size.height/2;
    self.deslabel.center=iconcenter;
    
    
    self.hotlabel.frame=CGRectMake(AfW(34), AfW(21), AfW(48), AfW(21));
    CGPoint hotlabelcenter= self.hotlabel.center;
    hotlabelcenter.y=self.contentView.frame.size.height/2;
    self.hotlabel.center=hotlabelcenter;
   
    
    self.rightimg.frame=CGRectMake(CGRectGetMaxX(self.deslabel.frame)+AfW(28), AfW(21), 8, 8);
    CGPoint rightimgcenter= self.rightimg.center;
    rightimgcenter.y=self.contentView.frame.size.height/2;
    self.rightimg.center=rightimgcenter;
    
    self.circleimg.frame=CGRectMake(AfW(62), AfW(25), 8, 8);
    CGPoint circleimgc= self.circleimg.center;
    circleimgc.y=self.contentView.frame.size.height/2;
    self.circleimg.center=circleimgc;
    
}

@end
